﻿using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace furion.blog.Domain.MySQL
{
    /// <summary>
    /// 
    ///</summary>
    [SugarTable("area_code")]
    public class AreaCode : BaseModel
    {
        /// <summary>
        /// 区划代码 
        ///</summary>
        [SugarColumn(ColumnName = "code", IsPrimaryKey = true)]
        public long Code { get; set; }
        /// <summary>
        /// 名称 
        /// 默认值: 
        ///</summary>
        [SugarColumn(ColumnName = "name")]
        public string Name { get; set; }
        /// <summary>
        /// 级别1-5,省市县镇村 
        ///</summary>
        [SugarColumn(ColumnName = "level")]
        public byte Level { get; set; }
        /// <summary>
        /// 父级区划代码 
        ///</summary>
        [SugarColumn(ColumnName = "pcode")]
        public long? Pcode { get; set; }

        /// <summary>
        /// 子地区
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<AreaCode> Children { get; set; } = null;
    }
}
